home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 15 code / 3D Interface / 3D Buttons CDEF / Source / 3D Buttons CDEF source / (3D Buttons CDEF.π) / LGBIconButton.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-06  |  1.9 KB  |  99 lines  |  [TEXT/MMCC]

  1. /**************************************************************************
  2.     LGBIconButton
  3.     
  4.     Public domain, by Zig Zichterman.
  5.     
  6.     This class implements 3D icon push buttons according to the guidelines
  7.     suggested in _develop_ 15. Some of the drawing code is taken from
  8.     the public domain source accompanying _develop_ 15.
  9.  
  10.     A new button variant that draws an icon button.  The icon draws
  11.     in a rectangular frame with 3D effects.
  12.     
  13.     LGBIconButton uses contrlValue for the resource id of the icon family.
  14.     You must set contrlValue (and probably contrlMax).
  15.     
  16.     LGBIconButton does not draw a title. Ever. Since it is bad HI to
  17.     display an icon without an accompanying text, you should place a 
  18.     caption near this button to clue the user in to just what your
  19.     icon means.
  20.  
  21.     1.0b5
  22.         12/06/94    zz    inactive colors
  23. **************************************************************************/
  24. #pragma once
  25.  
  26. class LGBIconButton {
  27.     public :
  28.         static long
  29.         Main(
  30.         short            inVariation,
  31.         ControlHandle    ioControl,
  32.         short            inMsg,
  33.         long            ioParam);
  34.  
  35.     // ———— constructor —————————————————————————————————————————————
  36.     protected :
  37.         GrafPtr            mWindowPort;
  38.         RGBColor        mBackgroundColor;
  39.         RGBColor        mInactiveFrameColor;
  40.         
  41.         LGBIconButton(
  42.             ControlHandle    inControl);
  43.  
  44.         ControlHandle    mControl;
  45.         
  46.     // ———— dispatch —————————————————————————————————————————————————
  47.     protected :
  48.         void
  49.         Draw(
  50.             long    inPartCode);
  51.             
  52.         Boolean
  53.         Test(
  54.             Point    inHitPt);
  55.             
  56.         void
  57.         CalcCRgn(
  58.             RgnHandle    ioRgn);
  59.         
  60.     // ———— Draw —————————————————————————————————————————————————————
  61.     protected :
  62.         void
  63.         DrawBW(void);
  64.         
  65.         void
  66.         DrawBW3D(void);
  67.         
  68.         void
  69.         DrawColor(void);
  70.         
  71.         void
  72.         DrawColorInactive(void);
  73.         
  74.         void
  75.         DrawColorActive(void);
  76.         
  77.         void
  78.         DrawFrame(void);
  79.         
  80.         void
  81.         EraseInsides(void);
  82.         
  83.         void
  84.         DrawIcon(
  85.             Boolean    inColor = true);
  86.         
  87.         void
  88.         Draw3DEffects(void);
  89.  
  90.         void
  91.         CalcColors(void);
  92.         
  93.         void
  94.         UseBackgroundColor(void);
  95.         
  96.         void
  97.         UseInactiveFrameColor(void);
  98. };
  99.